package com.xywy.beautyand.util;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import android.util.Log;

/**
 * Log������
 * 
 */
public class LogUtil {

	//���ڷ���ʱ,�ص�log
	private static boolean isLog = true;

	public static void d(Object object, String msg) {
		if (isLog) {
			Log.d(object.getClass().getSimpleName(), "......... "+ msg+" ...........");
		}
	}
	public static void d(String tag, String msg) {
		if (isLog) {
			Log.d(tag, "...... "+ msg+" .......");
		}
	}
	
	public static void i(String tag, String msg) {
		if (isLog) {
			Log.i(tag, "....... "+ msg+" .......");
		}
	}
	public static void i(Object object, String msg) {
		if (isLog) {
			Log.i(object.getClass().getSimpleName(), "..........."+ msg+" ...........");
		}
	}
	public static void i_urldecode(Object object, String msg) {
		if (isLog) {
			try {
				Log.i(object.getClass().getSimpleName(), ".......... "+ URLDecoder.decode(msg, "UTF-8")+" .........");
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			}
		}
	}
	
	
	public static void v(String tag, String msg) {
		if (isLog) {
			Log.v(tag, msg);
		}
	}
	
	
	public static void e(Object object, String msg) {
		if (isLog) {
			Log.e(object.getClass().getSimpleName(),"..........."+ msg+" ............");
		}
	}
	public static void e_urldecode(Object object, String msg) {
		if (isLog) {
			try {
				Log.e(object.getClass().getSimpleName(),"............. "+ URLDecoder.decode(msg, "UTF-8")+" .............");
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			}
		}
	}
	public static void e(String tag, String msg) {
		if (isLog) {
			Log.e(tag, ".............. "+ msg+" ..............");
		}
	}
	

	public static void e(String tag, String msg,Throwable throwable) {
		if (isLog) {
			Log.e(tag, msg, throwable);
		}
	}
}
